<?php include "../public/header.php"?>
<?php include "../public/header_public.php"?>
<body class="laytp-container">
<div style="height: 45px"></div>
<div id="opt_nav">
</div>
<div id="dialog">
    <div class="page-title" id="page-title">
        <div class="page-title-con">
            <span class="title">明细记录</span>
            <div class="move_title"></div>
            <div class="page-title-opt-list">
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
</div>

<div class="layui-card" id="table-card">
    <div class="layui-card-body">
        <div class="layui-row">
            <div class="layui-col-md12" id="table_list">
                <div class="layui-card-body">
                    <table id="datalist" lay-filter="datalist"></table>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/html" id="test-dropdown-toolbar-barDemo">
    <div class="tab-list-authbut">

    </div>
</script>
<script type="text/html" id="toolbarDemo">
    <div class = "layui-btn-container">
    </div>
</script>
<script type="text/javascript">
    var parent_idstr = getQueryVariable('idstr') || '';
    var parent_chatype = getQueryVariable('chatype') || 0;

    var currButAuth, currTabData;
    layui.use(["laytp",'laypage','table','dropdown','form','soulTable'], function () {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable;
        $("#search_table").hide();
        setSouTableExport('明细记录');
        var mytable = table.render({
            elem: "#datalist",id: "datalist"
            ,url: facade.url(ask_stuff_ku_detail),where: {idstr:parent_idstr,chatype:parent_chatype}, page: false
            ,soulSort: TabInit.soulSort,method: TabInit.method, toolbar: TabInit.toolbar, overflow: TabInit.overflow
            ,defaultToolbar: TabInit.defaultToolbar,filter: TabInit.filter
            ,request: TabInit.request,response: TabInit.response,contextmenu:get_table_contextmenu(soulTable)
            ,parseData: function (res) {
                currButAuth = res.data.butauth;
                tableButShow(currButAuth);


                render_from();
                return {
                    "code": res.code,
                    "msg": res.message,
                    "count": res.data.total,
                    "data": res.data
                };
            }
            , cols: [[
                {type: "checkbox", fixed: 'left'}
                ,{type:'numbers',title:'序号',fixed:'left'}
                ,{field: 'number', title: '单号'}
                ,{field: 'dt', title: '日期'}
                ,{field: 'dongname', title: '动作'}
                ,{field: 'name', title: '物资名称及规格'}
                ,{field: 'unit', title: '单位'}
                ,{field: 'price', title: '单价(元)',align:'right',templet: function(d){return parseFormatNum(d.price);}}
                ,{field: 'num', title: '数量'}
                ,{field: 'money', title: '金额(元)',align:'right',templet: function(d){return parseFormatNum(d.money);}}
                ,{field: 'baner', title: '经手人'}
                ,{field: 'gonger', title: '供应商'}
                ,{field: 'enginname', title: '项目名称'}
                ,{field: 'caiid_name', title: '合同名称'}
            ]]
            , done: function (res) {
                soulTable.render(this);

            }
        });


        listTableSearch(form, table);
    });




    function layer_close(){
        try {
            parent.layui.table.reload('datalist');
        }catch (e) {

        }
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
    }

</script>
</body>
</html>
